{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from scipy import stats\n",
    "import statsmodels.api as sm \n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_excel('D:/Python/Data_Files/Housing.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>House Price</th>\n",
       "      <th>House Size (sq.ft.)</th>\n",
       "      <th>State</th>\n",
       "      <th>Number of Rooms</th>\n",
       "      <th>Year of Construction</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1116000</td>\n",
       "      <td>1940</td>\n",
       "      <td>IN</td>\n",
       "      <td>8</td>\n",
       "      <td>2002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>860000</td>\n",
       "      <td>1300</td>\n",
       "      <td>IN</td>\n",
       "      <td>5</td>\n",
       "      <td>1992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>818400</td>\n",
       "      <td>1420</td>\n",
       "      <td>IN</td>\n",
       "      <td>6</td>\n",
       "      <td>1987</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1000000</td>\n",
       "      <td>1680</td>\n",
       "      <td>IN</td>\n",
       "      <td>7</td>\n",
       "      <td>2000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>640000</td>\n",
       "      <td>1270</td>\n",
       "      <td>IN</td>\n",
       "      <td>5</td>\n",
       "      <td>1995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1010000</td>\n",
       "      <td>1850</td>\n",
       "      <td>IN</td>\n",
       "      <td>7</td>\n",
       "      <td>1998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>600000</td>\n",
       "      <td>1000</td>\n",
       "      <td>IN</td>\n",
       "      <td>4</td>\n",
       "      <td>2015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>700000</td>\n",
       "      <td>1100</td>\n",
       "      <td>LA</td>\n",
       "      <td>4</td>\n",
       "      <td>2014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1100000</td>\n",
       "      <td>1600</td>\n",
       "      <td>LA</td>\n",
       "      <td>7</td>\n",
       "      <td>2017</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>570000</td>\n",
       "      <td>1000</td>\n",
       "      <td>NY</td>\n",
       "      <td>5</td>\n",
       "      <td>1997</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>860000</td>\n",
       "      <td>2150</td>\n",
       "      <td>NY</td>\n",
       "      <td>9</td>\n",
       "      <td>1997</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1085000</td>\n",
       "      <td>1900</td>\n",
       "      <td>NY</td>\n",
       "      <td>9</td>\n",
       "      <td>2000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1250000</td>\n",
       "      <td>2200</td>\n",
       "      <td>NY</td>\n",
       "      <td>9</td>\n",
       "      <td>2014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>850000</td>\n",
       "      <td>1100</td>\n",
       "      <td>TX</td>\n",
       "      <td>4</td>\n",
       "      <td>2017</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>640000</td>\n",
       "      <td>860</td>\n",
       "      <td>TX</td>\n",
       "      <td>4</td>\n",
       "      <td>1997</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>900000</td>\n",
       "      <td>1325</td>\n",
       "      <td>TX</td>\n",
       "      <td>6</td>\n",
       "      <td>1997</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>730000</td>\n",
       "      <td>1350</td>\n",
       "      <td>TX</td>\n",
       "      <td>6</td>\n",
       "      <td>2000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>750000</td>\n",
       "      <td>1600</td>\n",
       "      <td>TX</td>\n",
       "      <td>6</td>\n",
       "      <td>1992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>650000</td>\n",
       "      <td>950</td>\n",
       "      <td>TX</td>\n",
       "      <td>2</td>\n",
       "      <td>1987</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>680000</td>\n",
       "      <td>1250</td>\n",
       "      <td>TX</td>\n",
       "      <td>4</td>\n",
       "      <td>2000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    House Price  House Size (sq.ft.) State  Number of Rooms  \\\n",
       "0       1116000                 1940    IN                8   \n",
       "1        860000                 1300    IN                5   \n",
       "2        818400                 1420    IN                6   \n",
       "3       1000000                 1680    IN                7   \n",
       "4        640000                 1270    IN                5   \n",
       "5       1010000                 1850    IN                7   \n",
       "6        600000                 1000    IN                4   \n",
       "7        700000                 1100   LA                 4   \n",
       "8       1100000                 1600   LA                 7   \n",
       "9        570000                 1000    NY                5   \n",
       "10       860000                 2150    NY                9   \n",
       "11      1085000                 1900    NY                9   \n",
       "12      1250000                 2200    NY                9   \n",
       "13       850000                 1100    TX                4   \n",
       "14       640000                  860    TX                4   \n",
       "15       900000                 1325    TX                6   \n",
       "16       730000                 1350    TX                6   \n",
       "17       750000                 1600    TX                6   \n",
       "18       650000                  950    TX                2   \n",
       "19       680000                 1250    TX                4   \n",
       "\n",
       "    Year of Construction  \n",
       "0                   2002  \n",
       "1                   1992  \n",
       "2                   1987  \n",
       "3                   2000  \n",
       "4                   1995  \n",
       "5                   1998  \n",
       "6                   2015  \n",
       "7                   2014  \n",
       "8                   2017  \n",
       "9                   1997  \n",
       "10                  1997  \n",
       "11                  2000  \n",
       "12                  2014  \n",
       "13                  2017  \n",
       "14                  1997  \n",
       "15                  1997  \n",
       "16                  2000  \n",
       "17                  1992  \n",
       "18                  1987  \n",
       "19                  2000  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>House Price</th>\n",
       "      <th>House Size (sq.ft.)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1116000</td>\n",
       "      <td>1940</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>860000</td>\n",
       "      <td>1300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>818400</td>\n",
       "      <td>1420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1000000</td>\n",
       "      <td>1680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>640000</td>\n",
       "      <td>1270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1010000</td>\n",
       "      <td>1850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>600000</td>\n",
       "      <td>1000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>700000</td>\n",
       "      <td>1100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1100000</td>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>570000</td>\n",
       "      <td>1000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>860000</td>\n",
       "      <td>2150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1085000</td>\n",
       "      <td>1900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1250000</td>\n",
       "      <td>2200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>850000</td>\n",
       "      <td>1100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>640000</td>\n",
       "      <td>860</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>900000</td>\n",
       "      <td>1325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>730000</td>\n",
       "      <td>1350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>750000</td>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>650000</td>\n",
       "      <td>950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>680000</td>\n",
       "      <td>1250</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    House Price  House Size (sq.ft.)\n",
       "0       1116000                 1940\n",
       "1        860000                 1300\n",
       "2        818400                 1420\n",
       "3       1000000                 1680\n",
       "4        640000                 1270\n",
       "5       1010000                 1850\n",
       "6        600000                 1000\n",
       "7        700000                 1100\n",
       "8       1100000                 1600\n",
       "9        570000                 1000\n",
       "10       860000                 2150\n",
       "11      1085000                 1900\n",
       "12      1250000                 2200\n",
       "13       850000                 1100\n",
       "14       640000                  860\n",
       "15       900000                 1325\n",
       "16       730000                 1350\n",
       "17       750000                 1600\n",
       "18       650000                  950\n",
       "19       680000                 1250"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[['House Price', 'House Size (sq.ft.)']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Univariate Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = data['House Size (sq.ft.)']\n",
    "Y = data['House Price']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     1940\n",
       "1     1300\n",
       "2     1420\n",
       "3     1680\n",
       "4     1270\n",
       "5     1850\n",
       "6     1000\n",
       "7     1100\n",
       "8     1600\n",
       "9     1000\n",
       "10    2150\n",
       "11    1900\n",
       "12    2200\n",
       "13    1100\n",
       "14     860\n",
       "15    1325\n",
       "16    1350\n",
       "17    1600\n",
       "18     950\n",
       "19    1250\n",
       "Name: House Size (sq.ft.), dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     1116000\n",
       "1      860000\n",
       "2      818400\n",
       "3     1000000\n",
       "4      640000\n",
       "5     1010000\n",
       "6      600000\n",
       "7      700000\n",
       "8     1100000\n",
       "9      570000\n",
       "10     860000\n",
       "11    1085000\n",
       "12    1250000\n",
       "13     850000\n",
       "14     640000\n",
       "15     900000\n",
       "16     730000\n",
       "17     750000\n",
       "18     650000\n",
       "19     680000\n",
       "Name: House Price, dtype: int64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAD8CAYAAABQFVIjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHDpJREFUeJzt3XGQlPd93/H3pyCRs1PpAF0oHKgwEaGVrMaYLVJC43FN\nyhHXE6hG1dBJRueGkZpI48ZOhxjqmTKVMiMwmSHVdKQOEzlCqitECEbMaJTTFZzon4J06GwDks+c\ng2VYIUF0nNSJb1RQvv1jf2v2Vscdd/tw++zu5zWzs89+n+f32+/u8PC95/d7nmcVEZiZmdXqH9Q7\nATMzaw4uKGZmlgkXFDMzy4QLipmZZcIFxczMMuGCYmZmmXBBMTOzTLigmJlZJlxQzMwsEzPrncB0\nuuWWW2Lx4sX1TsPMrKEcO3bsbyOiY6LtWqqgLF68mL6+vnqnYWbWUCS9dS3becjLzMwy4YJiZmaZ\ncEExM7NMuKCYmVkmXFDMzCwTLXWWl5lZKznQX2RHzwBvD4+woL2NTV3LWL+887q9nwuKmVkTOtBf\nZMv+44xc+giA4vAIW/YfB7huRcVDXmZmTWhHz8DPiknZyKWP2NEzcN3e0wXFzKwJvT08Mql4FlxQ\nzMya0IL2tknFs+CCYmbWhDZ1LaPthhmjYm03zGBT17Lr9p6elDcza0LliXef5WVmZjVbv7zzuhaQ\nah7yMjOzTLigmJlZJlxQzMwsEy4oZmaWCRcUMzPLhAuKmZllYsKCIumbks5LOlER2yHpB5K+L+nb\nktor1m2RNChpQFJXRXyFpONp3eOSlOKzJD2f4kclLa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VBAX4dOB0RFyLiErAf+FXg3XRoR3ouDxUUKY2j\nly1MsXqZbJ5FrhzSVsannaQvAV8EfivtfJDfvH+R0h8d35P04/T+r0v6R+Q3Zyj99bg/Sl4F/p7S\nPZrynDNAN6V9EeDPuTKsnJu8Jd1A6T/mb0VEOddc749Xybm+++L1mDCq1wO4CzhJae5ElMY9vwzs\nYPTk2jfS8h2Mnqj6G6ZpUj69/2JGT15OOk8+PqH2hTrkvRZ4A+io2i43eVfnXLXux1yZlM9tzsDv\nAo+k5V+iNIShPOV8lbzfBD6XllcDx/L0Xaf3eAb4k6p4bvfHcXKu6754Xf9h1eMB/FfgB8AJ4Nn0\nBc4FDgGnKJ0lM6di+69TOuNhgOt8BkxVns9Rmue5ROkvz41TyRMopM/6I+C/ky5Wnea8B9N/bt9N\nj/+Rp7zHyrlq/Y9JBSXPOQM3Av8z5fA68Pk85TxO3v8COJb+QzsKrMhT3im/AL5f8W/4C3neH8fJ\nua77oq+UNzOzTDTbHIqZmdWJC4qZmWXCBcXMzDLhgmJmZplwQTEzs0y4oJiZWSZcUMzMLBMuKGZm\nlon/D4rMmTGFf4KDAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xbac90f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X,Y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ0AAAD8CAYAAACsAHnpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGwpJREFUeJzt3X+QVed93/H3JyCRlR3xS1uKFjysI6wMijPG3MG0ynhc\nqcMSOxOwRyNtpqk2KSPqgcZOk8oC+w88UmaE6jbqMK3VUksVUjxCDFEkphYlK6GMM54ItBjJCMmU\ndZAs1iA2LIi0oaqQv/3jPrccL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Ba6PiJej/D/riUyblnGFc3El\nk/1cHI+IH6blvwPepHwXk7b7bIxyLq6kYeeiHZJOu94uJ4AXJO1Pd2UAmBMRx9PyCWBOWm6HczTe\nY+9Ky9XxyeL3Jf0oTb9VppPa5lxIWgAsBvbS5p+NqnMBE/zZaIek065+PSI+Rfku3OskfTa7Mv1W\n0pali+187MkjlKebPwUcB/59c3cnX5I+CvwZ8AcRcTa7rt0+G5c5FxP+2WiHpDOm2+VMNhExlN5P\nAn9Oebrs3TQcJr2fTJu3wzka77EPpeXqeMuLiHcj4sOI+DnwX7kwlTrpz4Wkayj/kP1uRDyTwm35\n2bjcucjjs9EOSaftbpcj6SOSfqmyDCwHXqd83H1psz7gubS8E+iVNE1SN7CQ8sXByWRcx56mW85K\nWpaqce7OtGlplR+wyRcpfzZgkp+LtO+PAm9GxJ9kVrXdZ+NK5yKXz0azqyjyeAGfp1yd8RPgG83e\nnxyO9+OUK01eAw5VjhmYDbwIHAFeAGZl2nwjnZ/DtFglzmWO/ynKUwMfUJ5jXl3LsQOl9J/uJ8B/\nJP0xdSu9rnAungQOAj9KP0zmtsm5+HXKU2c/Al5Nr8+342djlHMx4Z8N35HAzMxy0w7Ta2ZmVhBO\nOmZmlhsnHTMzy42TjpmZ5cZJx8zMcuOkY2ZmuXHSMTOz3DjpmJlZbv4fyP9sQuJzjmEAAAAASUVO\nRK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xbca7b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X,Y)\n",
    "plt.axis([0, 2500, 0, 1500000])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAasAAAEKCAYAAACsUXomAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X28VVW97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8T2ni+rWWVedd2sRUl6\nPzAlIr7Yy/xfAl6IiK/28ThfB5ZGxO19b6VZxj0rsxYVETfWaYbegw5Utq/cszIzs8LzBAszMys8\nByszMys8ByszMys8ByszMys8ByszMys8ByszMyu8/w9iQTsZkDEXlwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xbeff9e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X,Y)\n",
    "plt.axis([0, 2500, 0, 1500000])\n",
    "plt.ylabel('House Price')\n",
    "plt.xlabel('House Size (sq.ft)')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "X1 = sm.add_constant(X)\n",
    "\n",
    "reg = sm.OLS(Y, X1).fit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<caption>OLS Regression Results</caption>\n",
       "<tr>\n",
       "  <th>Dep. Variable:</th>       <td>House Price</td>   <th>  R-squared:         </th> <td>   0.678</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Model:</th>                   <td>OLS</td>       <th>  Adj. R-squared:    </th> <td>   0.660</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Method:</th>             <td>Least Squares</td>  <th>  F-statistic:       </th> <td>   37.95</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Date:</th>             <td>Sat, 25 Mar 2017</td> <th>  Prob (F-statistic):</th> <td>8.13e-06</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Time:</th>                 <td>13:19:31</td>     <th>  Log-Likelihood:    </th> <td> -260.43</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>No. Observations:</th>      <td>    20</td>      <th>  AIC:               </th> <td>   524.9</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Residuals:</th>          <td>    18</td>      <th>  BIC:               </th> <td>   526.8</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Model:</th>              <td>     1</td>      <th>                     </th>     <td> </td>   \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Covariance Type:</th>      <td>nonrobust</td>    <th>                     </th>     <td> </td>   \n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "           <td></td>              <th>coef</th>     <th>std err</th>      <th>t</th>      <th>P>|t|</th> <th>[95.0% Conf. Int.]</th> \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>const</th>               <td> 2.608e+05</td> <td> 9.76e+04</td> <td>    2.673</td> <td> 0.016</td> <td> 5.58e+04  4.66e+05</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>House Size (sq.ft.)</th> <td>  401.9163</td> <td>   65.243</td> <td>    6.160</td> <td> 0.000</td> <td>  264.846   538.987</td>\n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "  <th>Omnibus:</th>       <td> 1.238</td> <th>  Durbin-Watson:     </th> <td>   1.810</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Prob(Omnibus):</th> <td> 0.538</td> <th>  Jarque-Bera (JB):  </th> <td>   0.715</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Skew:</th>          <td>-0.459</td> <th>  Prob(JB):          </th> <td>   0.699</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Kurtosis:</th>      <td> 2.884</td> <th>  Cond. No.          </th> <td>5.66e+03</td>\n",
       "</tr>\n",
       "</table>"
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.summary.Summary'>\n",
       "\"\"\"\n",
       "                            OLS Regression Results                            \n",
       "==============================================================================\n",
       "Dep. Variable:            House Price   R-squared:                       0.678\n",
       "Model:                            OLS   Adj. R-squared:                  0.660\n",
       "Method:                 Least Squares   F-statistic:                     37.95\n",
       "Date:                Sat, 25 Mar 2017   Prob (F-statistic):           8.13e-06\n",
       "Time:                        13:19:31   Log-Likelihood:                -260.43\n",
       "No. Observations:                  20   AIC:                             524.9\n",
       "Df Residuals:                      18   BIC:                             526.8\n",
       "Df Model:                           1                                         \n",
       "Covariance Type:            nonrobust                                         \n",
       "=======================================================================================\n",
       "                          coef    std err          t      P>|t|      [95.0% Conf. Int.]\n",
       "---------------------------------------------------------------------------------------\n",
       "const                2.608e+05   9.76e+04      2.673      0.016      5.58e+04  4.66e+05\n",
       "House Size (sq.ft.)   401.9163     65.243      6.160      0.000       264.846   538.987\n",
       "==============================================================================\n",
       "Omnibus:                        1.238   Durbin-Watson:                   1.810\n",
       "Prob(Omnibus):                  0.538   Jarque-Bera (JB):                0.715\n",
       "Skew:                          -0.459   Prob(JB):                        0.699\n",
       "Kurtosis:                       2.884   Cond. No.                     5.66e+03\n",
       "==============================================================================\n",
       "\n",
       "Warnings:\n",
       "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
       "[2] The condition number is large, 5.66e+03. This might indicate that there are\n",
       "strong multicollinearity or other numerical problems.\n",
       "\"\"\""
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg.summary()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Expected value of Y:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "662800"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "260800 + 402 * 1000"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Alpha, Beta, R^2:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "slope, intercept, r_value, p_value, std_err = stats.linregress(X,Y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "401.91628631922595"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "slope"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "260806.23605609639"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "intercept"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.82357755346969241"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.67827998657912403"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_value ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8.1296423772313077e-06"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p_value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "65.242995106364916"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "std_err"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "ipykernel_py2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
